import scrapy


class DjSpider(scrapy.Spider):
    name = 'dj'
    allowed_domains = ['qunar.com']
    start_urls = ['https://dujia.qunar.com']

    def start_requests(self):
        url = "https://diy.dujia.qunar.com/api/destination/classify_pinyin.json?area=true&callback=jQuery172043876692969861875_1604293071025&_=1604293071066"
        url = 'https://diy.dujia.qunar.com/api/destination/classify_pinyin.json?area=false&callback=jQuery17209457865827034848_1604293434648&_=1604293434681'
        yield scrapy.Request(
            url,
            callback=self.parse,
        )

    # https://dujia.qunar.com/pqk/list_北京
    # list  https://dujia.qunar.com/golfz/routeList/adaptors/pcTop?t=all&lm=0,60&m=l,lm
    #       https://dujia.qunar.com/golfz/routeList/adaptors/pcTop?isTouch=0&t=all&o=pop-desc&lm=0,60&fhLimit=0,60&q=北京&d=北京&s=all&qs_ts=1604287095268&tm=djnull&sourcepage=list&userResident=深圳&random=202848&aroundWeight=1&qssrc=eyJ0cyI6IjE2MDQyODcwOTUyNjgiLCJzcmMiOiJhbGwuZW52YW5vIiwiYWN0Ijoic2VhcmNoIiwicmFuZG9tIjoiMjAyODQ4In0=&m=l,bookingInfo,browsingInfo,lm&displayStatus=pc&ddf=true&userId=00002b80306c2a2ce210b575&userName=qcezbce1357&hlFields=title&gpscity=深圳&lines6To10=0
    #       https://dujia.qunar.com/golfz/routeList/adaptors/pcTop?isTouch=0&t=all&o=pop-desc&lm=60,60&fhLimit=0,60&q=北京&d=北京&s=all&qs_ts=1604287095268&tm=djnull&sourcepage=list&userResident=深圳&random=202848&aroundWeight=1&qssrc=eyJ0cyI6IjE2MDQyODcwOTUyNjgiLCJzcmMiOiJhbGwuZW52YW5vIiwiYWN0Ijoic2Nyb2xsIiwicmFuZG9tIjoiMjAyODQ4In0=&m=l,bookingInfo,browsingInfo,lm&displayStatus=pc&ddf=true&userId=00002b80306c2a2ce210b575&userName=qcezbce1357&hlFields=title&gpscity=深圳&lines6To10=0
    #       https://dujia.qunar.com/golfz/routeList/adaptors/pcTop?isTouch=0&t=all&o=pop-desc&lm=120,60&fhLimit=0,60&q=北京&d=北京&s=all&qs_ts=1604287095268&tm=djnull&sourcepage=list&userResident=深圳&random=202848&aroundWeight=1&qssrc=eyJ0cyI6IjE2MDQyODcwOTUyNjgiLCJzcmMiOiJhbGwuZW52YW5vIiwiYWN0Ijoic2Nyb2xsIiwicmFuZG9tIjoiMjAyODQ4In0=&m=l,bookingInfo,browsingInfo,lm&displayStatus=pc&ddf=true&userId=00002b80306c2a2ce210b575&userName=qcezbce1357&hlFields=title&gpscity=深圳&lines6To10=0
    # top5  https://dujia.qunar.com/golfz/routeSetTopModule?topModules=vaps%2CplayCombination&vpasRows=7&vpasPage=0&isTouch=0&type=all&orderby=pop-desc&limit=0%2C60&fhLimit=0%2C60&query=%E5%8C%97%E4%BA%AC&dep=%E5%8C%97%E4%BA%AC&searchfrom=all&qs_ts=1604287095268&tm=djnull&sourcepage=list&userResident=%E6%B7%B1%E5%9C%B3&random=202848&aroundWeight=1&qssrc=eyJ0cyI6IjE2MDQyODcwOTUyNjgiLCJzcmMiOiJhbGwuZW52YW5vIiwiYWN0Ijoic2VhcmNoIiwicmFuZG9tIjoiMjAyODQ4In0%3D&modules=listTop%2CbookingInfo%2CbrowsingInfo&ddf=true&hlFields=title&displayStatus=pc&abtest=a&ipcity=
    # detail
    #   费用说明：https://bjjm2.package.qunar.com/user/detail/getDetail.json?pId=3205475031&isVer=false&oid=&tuId=&tId=2125669748&takeoffDate=2020-11-03
    #   费用价格：https://bjjm2.package.qunar.com/api/calPrices.json?tuId=&pId=3205475031&month=2020-11&caller=detail&_=1604290241535
    #   套餐：https://bjjm2.package.qunar.com/api/duplicateProduct/teamPrice.json?pId=3205475031&month=2020-11&dep=%E5%8C%97%E4%BA%AC&_=1604290241537
    #   交通：https://bjjm2.package.qunar.com/user/detail/getTrffcHtlInfo.json?pId=3205475031&isVer=false&oid=&tId=2125669748
    #   行程、景点、用餐：https://bjjm2.package.qunar.com/user/detail/getSchedule.json?pId=3205475031&isVer=false&oid=


    def parse(self, response):
        pass
